package com.hfut.eeg.common.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.ArrayList;

/**
 * @author 梁琦
 * @program: eeg
 * @Package com.hfut.eeg.common.util
 * @Description: 修改数据获取频率
 * @date 2019-12-25 11:10
 */
@Component
public class FSChangeUtil {
    @Value("${eeg.dataFS}")
    private int dataFS;

    @Value("${eeg.dataFre}")
    private int dataFre;

    public static ArrayList<ArrayList> fsChange(ArrayList<ArrayList> data){
        ArrayList<ArrayList> result = new ArrayList<>();
        if(data==null || data.size()==0){
            return null;
        }
        for (ArrayList list:data){
            ArrayList tmp = new ArrayList();
            for (int i=0;i<list.size();){
                tmp.add(list.get(i));
                i = i+4;
            }
            result.add(tmp);
        }
        return result;
    }
}
